package com.xy.example2;

/**
 * @author 谢阳
 * @version 1.8.0_131
 * @date 2022/6/14 10:05
 * @description
 */
public class MoBikeFlyweight extends BikeFlyweight {

    // 定义新的累不状态，车牌号
    private String bikeId;

    public MoBikeFlyweight(String bikeId) {
        this.bikeId = bikeId;
    }

    @Override
    void ride(User user) {
        state = 1;
        System.out.println(user.getName() + "骑" + bikeId + "自行车出行");
    }

    @Override
    void back() {
        state = 0;
    }

}
